/* ============================================
   Bolt.new Dark Theme
   Professional, modern dark theme inspired by Bolt.new
   ============================================ */

:root {
  /* Primary Dark Backgrounds */
  --bolt-bg-primary: #0d1117;
  --bolt-bg-secondary: #161b22;
  --bolt-bg-tertiary: #21262d;
  --bolt-bg-elevated: #1c2128;

  /* Borders and Dividers */
  --bolt-border: #30363d;
  --bolt-border-subtle: #21262d;
  --bolt-border-hover: #484f58;

  /* Text Colors */
  --bolt-text-primary: #e6edf3;
  --bolt-text-secondary: #7d8590;
  --bolt-text-tertiary: #636e7b;
  --bolt-text-muted: #484f58;

  /* Accent Colors */
  --bolt-accent-blue: #1f6feb;
  --bolt-accent-blue-hover: #388bfd;
  --bolt-accent-blue-muted: rgba(31, 111, 235, 0.15);

  /* State Colors */
  --bolt-success: #3fb950;
  --bolt-warning: #d29922;
  --bolt-error: #f85149;
  --bolt-info: #58a6ff;

  /* Shadows */
  --bolt-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12);
  --bolt-shadow-md: 0 3px 6px rgba(0, 0, 0, 0.15);
  --bolt-shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.25);
  --bolt-shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.35);
}

/* ============================================
   Base Panel Styles
   ============================================ */

.bolt-panel {
  background-color: var(--bolt-bg-primary);
  color: var(--bolt-text-primary);
}

.bolt-panel-secondary {
  background-color: var(--bolt-bg-secondary);
  color: var(--bolt-text-primary);
}

.bolt-panel-tertiary {
  background-color: var(--bolt-bg-tertiary);
  color: var(--bolt-text-primary);
}

.bolt-panel-elevated {
  background-color: var(--bolt-bg-elevated);
  box-shadow: var(--bolt-shadow-md);
}

/* ============================================
   Border Utilities
   ============================================ */

.bolt-border {
  border-color: var(--bolt-border);
}

.bolt-border-subtle {
  border-color: var(--bolt-border-subtle);
}

.bolt-border-hover:hover {
  border-color: var(--bolt-border-hover);
}

.bolt-divide > * + * {
  border-top-color: var(--bolt-border);
}

/* ============================================
   Button Styles
   ============================================ */

.bolt-button-primary {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-weight: 500;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
}

.bolt-button-primary:hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
  transform: translateY(-1px);
}

.bolt-button-primary:active {
  transform: translateY(0);
}

.bolt-button-secondary {
  background-color: var(--bolt-bg-tertiary);
  color: var(--bolt-text-primary);
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-weight: 500;
  border: 1px solid var(--bolt-border);
  transition: all 0.2s ease;
  cursor: pointer;
}

.bolt-button-secondary:hover {
  background-color: var(--bolt-bg-elevated);
  border-color: var(--bolt-border-hover);
}

.bolt-button-ghost {
  background: transparent;
  color: var(--bolt-text-secondary);
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  border: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

.bolt-button-ghost:hover {
  background-color: var(--bolt-bg-tertiary);
  color: var(--bolt-text-primary);
}

.bolt-button-icon {
  background: transparent;
  color: var(--bolt-text-secondary);
  padding: 0.5rem;
  border-radius: 0.375rem;
  border: none;
  transition: all 0.2s ease;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.bolt-button-icon:hover {
  background-color: var(--bolt-bg-tertiary);
  color: var(--bolt-text-primary);
}

.bolt-button-icon:active {
  background-color: var(--bolt-bg-secondary);
}

/* Active/Selected State for Mode Buttons */
.bolt-button-mode-active {
  background-color: var(--bolt-accent-blue);
  color: white;
  border-color: var(--bolt-accent-blue);
}

.bolt-button-mode-active:hover {
  background-color: var(--bolt-accent-blue-hover);
}

/* ============================================
   Input Styles
   ============================================ */

.bolt-input {
  background-color: var(--bolt-bg-tertiary);
  color: var(--bolt-text-primary);
  border: 1px solid var(--bolt-border);
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem;
  transition: all 0.2s ease;
  width: 100%;
}

.bolt-input:focus {
  outline: none;
  border-color: var(--bolt-accent-blue);
  box-shadow: 0 0 0 3px var(--bolt-accent-blue-muted);
}

.bolt-input::placeholder {
  color: var(--bolt-text-muted);
}

.bolt-textarea {
  background-color: var(--bolt-bg-tertiary);
  color: var(--bolt-text-primary);
  border: 1px solid var(--bolt-border);
  border-radius: 0.375rem;
  padding: 0.75rem;
  transition: all 0.2s ease;
  resize: vertical;
  width: 100%;
  font-family: inherit;
}

.bolt-textarea:focus {
  outline: none;
  border-color: var(--bolt-accent-blue);
  box-shadow: 0 0 0 3px var(--bolt-accent-blue-muted);
}

/* ============================================
   File Tree Styles
   ============================================ */

.bolt-file-tree {
  background-color: var(--bolt-bg-secondary);
  color: var(--bolt-text-primary);
}

.bolt-file-tree-item {
  color: var(--bolt-text-primary);
  padding: 0.375rem 0.75rem;
  border-radius: 0.25rem;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.bolt-file-tree-item:hover {
  background-color: var(--bolt-bg-tertiary);
}

.bolt-file-tree-item-selected {
  background-color: var(--bolt-accent-blue);
  color: white;
}

.bolt-file-tree-item-selected:hover {
  background-color: var(--bolt-accent-blue-hover);
}

.bolt-file-tree-folder {
  font-weight: 500;
}

.bolt-file-tree-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

/* ============================================
   Chat Message Styles
   ============================================ */

.bolt-chat-container {
  background-color: var(--bolt-bg-primary);
}

.bolt-message-user {
  background-color: var(--bolt-bg-tertiary);
  color: var(--bolt-text-primary);
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid var(--bolt-border);
}

.bolt-message-assistant {
  background-color: var(--bolt-bg-secondary);
  color: var(--bolt-text-primary);
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid var(--bolt-border-subtle);
}

.bolt-message-system {
  background-color: var(--bolt-accent-blue-muted);
  color: var(--bolt-text-primary);
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid var(--bolt-accent-blue);
}

.bolt-tool-execution {
  background-color: var(--bolt-bg-elevated);
  border: 1px solid var(--bolt-border);
  border-radius: 0.375rem;
  overflow: hidden;
}

.bolt-tool-execution-header {
  background-color: var(--bolt-bg-tertiary);
  padding: 0.5rem 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--bolt-border);
  cursor: pointer;
}

.bolt-tool-execution-body {
  padding: 0.75rem;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 0.875rem;
  color: var(--bolt-text-secondary);
}

/* ============================================
   Terminal Styles
   ============================================ */

.bolt-terminal {
  background-color: var(--bolt-bg-primary);
  color: var(--bolt-text-primary);
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

.bolt-terminal-header {
  background-color: var(--bolt-bg-secondary);
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--bolt-border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.bolt-terminal-tab {
  padding: 0.375rem 0.75rem;
  border-radius: 0.25rem;
  cursor: pointer;
  transition: all 0.15s ease;
  color: var(--bolt-text-secondary);
  font-weight: 500;
}

.bolt-terminal-tab:hover {
  background-color: var(--bolt-bg-tertiary);
  color: var(--bolt-text-primary);
}

.bolt-terminal-tab-active {
  background-color: var(--bolt-bg-tertiary);
  color: var(--bolt-text-primary);
}

/* ============================================
   Monaco Editor Container
   ============================================ */

.bolt-editor-container {
  background-color: var(--bolt-bg-primary);
  border: 1px solid var(--bolt-border);
  border-radius: 0.5rem;
  overflow: hidden;
}

.bolt-editor-header {
  background-color: var(--bolt-bg-secondary);
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--bolt-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.bolt-editor-tab {
  background-color: var(--bolt-bg-tertiary);
  color: var(--bolt-text-primary);
  padding: 0.375rem 0.75rem;
  border-radius: 0.25rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ============================================
   Preview Pane Styles
   ============================================ */

.bolt-preview-container {
  background-color: var(--bolt-bg-primary);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.bolt-preview-header {
  background-color: var(--bolt-bg-secondary);
  padding: 0.75rem;
  border-bottom: 1px solid var(--bolt-border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.bolt-preview-address-bar {
  flex: 1;
  background-color: var(--bolt-bg-tertiary);
  color: var(--bolt-text-primary);
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--bolt-border);
  border-radius: 0.375rem;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.875rem;
}

.bolt-preview-iframe {
  flex: 1;
  border: none;
  background-color: white;
}

/* ============================================
   Modal Styles
   ============================================ */

.bolt-modal-overlay {
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
}

.bolt-modal-content {
  background-color: var(--bolt-bg-secondary);
  border: 1px solid var(--bolt-border);
  border-radius: 0.75rem;
  box-shadow: var(--bolt-shadow-xl);
  color: var(--bolt-text-primary);
}

.bolt-modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--bolt-border);
}

.bolt-modal-body {
  padding: 1.5rem;
}

.bolt-modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--bolt-border);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* ============================================
   Scrollbar Styles (Dark Theme)
   ============================================ */

.bolt-scrollbar::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.bolt-scrollbar::-webkit-scrollbar-track {
  background-color: var(--bolt-bg-secondary);
}

.bolt-scrollbar::-webkit-scrollbar-thumb {
  background-color: var(--bolt-bg-tertiary);
  border-radius: 4px;
}

.bolt-scrollbar::-webkit-scrollbar-thumb:hover {
  background-color: var(--bolt-border-hover);
}

/* ============================================
   Card Styles
   ============================================ */

.bolt-card {
  background-color: var(--bolt-bg-secondary);
  border: 1px solid var(--bolt-border);
  border-radius: 0.5rem;
  padding: 1rem;
  transition: all 0.2s ease;
}

.bolt-card:hover {
  border-color: var(--bolt-border-hover);
  box-shadow: var(--bolt-shadow-md);
}

.bolt-card-clickable {
  cursor: pointer;
}

.bolt-card-clickable:hover {
  transform: translateY(-2px);
}

/* ============================================
   Resize Handle
   ============================================ */

.bolt-resize-handle {
  background-color: var(--bolt-border);
  transition: background-color 0.2s ease;
}

.bolt-resize-handle:hover {
  background-color: var(--bolt-accent-blue);
}

.bolt-resize-handle:active {
  background-color: var(--bolt-accent-blue-hover);
}

/* ============================================
   Top Bar (Mode Toggle)
   ============================================ */

.bolt-top-bar {
  background-color: var(--bolt-bg-secondary);
  border-bottom: 1px solid var(--bolt-border);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.bolt-mode-button {
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  border: 1px solid var(--bolt-border);
  background-color: transparent;
  color: var(--bolt-text-secondary);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.bolt-mode-button:hover {
  background-color: var(--bolt-bg-tertiary);
  color: var(--bolt-text-primary);
  border-color: var(--bolt-border-hover);
}

.bolt-mode-button-active {
  background-color: var(--bolt-accent-blue);
  color: white;
  border-color: var(--bolt-accent-blue);
}

.bolt-mode-button-active:hover {
  background-color: var(--bolt-accent-blue-hover);
}

/* ============================================
   Utility Classes
   ============================================ */

.bolt-text-muted {
  color: var(--bolt-text-muted);
}

.bolt-text-secondary {
  color: var(--bolt-text-secondary);
}

.bolt-text-primary {
  color: var(--bolt-text-primary);
}

.bolt-text-success {
  color: var(--bolt-success);
}

.bolt-text-warning {
  color: var(--bolt-warning);
}

.bolt-text-error {
  color: var(--bolt-error);
}

.bolt-text-info {
  color: var(--bolt-info);
}

/* ============================================
   Animations
   ============================================ */

@keyframes bolt-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes bolt-slide-in-up {
  from {
    transform: translateY(10px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes bolt-slide-in-down {
  from {
    transform: translateY(-10px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.bolt-animate-fade-in {
  animation: bolt-fade-in 0.2s ease-out;
}

.bolt-animate-slide-up {
  animation: bolt-slide-in-up 0.3s ease-out;
}

.bolt-animate-slide-down {
  animation: bolt-slide-in-down 0.3s ease-out;
}

/* ============================================
   Code Block Styles
   ============================================ */

.bolt-code-block {
  background-color: var(--bolt-bg-tertiary);
  border: 1px solid var(--bolt-border);
  border-radius: 0.375rem;
  padding: 0.75rem;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 0.875rem;
  color: var(--bolt-text-primary);
  overflow-x: auto;
}

.bolt-inline-code {
  background-color: var(--bolt-bg-tertiary);
  color: var(--bolt-accent-blue);
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 0.875em;
}

/* Code blocks in chat messages - prevent overflow */
.bolt-message-assistant pre,
.bolt-message-user pre,
.prose pre {
  max-width: 100% !important;
  overflow-x: auto !important;
}

.bolt-message-assistant code,
.bolt-message-user code {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Syntax highlighter specific fixes */
pre[class*="language-"] {
  max-width: 100% !important;
  overflow-x: auto !important;
  margin: 0.5rem 0 !important;
}

/* ============================================
   Badge Styles
   ============================================ */

.bolt-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.bolt-badge-primary {
  background-color: var(--bolt-accent-blue-muted);
  color: var(--bolt-accent-blue);
}

.bolt-badge-success {
  background-color: rgba(63, 185, 80, 0.15);
  color: var(--bolt-success);
}

.bolt-badge-warning {
  background-color: rgba(210, 153, 34, 0.15);
  color: var(--bolt-warning);
}

.bolt-badge-error {
  background-color: rgba(248, 81, 73, 0.15);
  color: var(--bolt-error);
}
